
project, original("../data_input/bowen_green/legprof-components.v1.1.1.dta")




		use "../data_input/bowen_green/legprof-components.v1.1.1.dta", clear

		drop if inlist(sessid, 1, 2, 3, 4, 5, 6, 7, 8, 9)
		rename mds1  prof
		collapse (mean) salary_real_mean = salary_real prof_mean = prof (min) salary_real_min = salary_real prof_min = prof (max) salary_real_max = salary_real prof_max =  prof  , by(state)

		gen termlimit = regexm(state, "Arkan|Arizo|Califor|Colora|Florid|Louisi|Maine|Michi|Missouri|Montana|Nevad|Ohio|Oklaho|South Dako")
		replace termlimit = 2 if regexm(state, "New York|Texas")
		sort prof_mean

		gen rank = _n
		
		sum 
		
		forval i=1/`r(N)'  { 
			local ycord = `i'
			local xcord = prof_min[`i'] -0.25
			local outcome = state[`i']
			local call `call' text(`ycord' `xcord'   "`outcome'",  size(small) placement(w))
		} 	
			
	
	
	twoway  (rspike prof_max prof_min rank if termlimit==0, horizontal lcolor(black) lwidth(medthin)) ///
			(dot prof_mean rank if termlimit==0 ,horizontal ndots(1) mcolor(black) msymbol(O) msize() mfcolor(white))  ///
			(rspike prof_max prof_min rank if termlimit==1, horizontal lcolor(red) lwidth(medthin)) ///
			(dot prof_mean rank if termlimit==1 ,horizontal ndots(1) mcolor(red) msymbol(square) msize() mfcolor(white)) ///
			(rspike prof_max prof_min rank if termlimit==2, horizontal lcolor(blue) lwidth(medthin)) ///
			(dot prof_mean rank if termlimit==2 ,horizontal ndots(1) mcolor(blue) msymbol(diamond) msize(large) mfcolor(blue)), ///
			`call' /// 
			subtitle(, bcolor(white)) graphregion(color(white))    ///
			ytitle("") xscale(range(-3 6)) xlabel( -3 (1) 8, labsize(medlarge) )  xtitle("Legislature Professionalization Index" "(Min-Mean-Max)") ///
			legend(order(2 "States without Term Limits" 4 "States with Term Limits" 6 "Added Control States without Term Limits") ring(0) cols(1) pos(5) ) ///
			graphregion(color(white)) bgcolor(white) ylabel("") yscale(lstyle(none)) scale(*0.65) xsize(10) ysize(8) 	
			graph export ../tables_figures/state_rank_prof.pdf, replace				
	
	
	

		macro drop _all 
		use "../data_input/bowen_green/legprof-components.v1.1.1.dta", clear

		drop if inlist(sessid, 1, 2, 3, 4, 5, 6, 7, 8, 9)
		rename mds1  prof
		collapse (mean) salary_real_mean = salary_real prof_mean = prof (min) salary_real_min = salary_real prof_min = prof (max) salary_real_max = salary_real prof_max =  prof  , by(state)

		gen termlimit = regexm(state, "Arkan|Arizo|Califor|Colora|Florid|Louisi|Maine|Michi|Missouri|Montana|Nevad|Ohio|Oklaho|South Dako")
		replace termlimit = 2 if regexm(state, "New York|Texas")
	
		sort salary_real_mean
		gen rank = _n
		
		sum 
		
		forval i=1/`r(N)'  { 
			local ycord = `i'
			local xcord = salary_real_min[`i'] -5
			local outcome = state[`i']
			local call `call' text(`ycord' `xcord'   "`outcome'",  size(small) placement(w))
		} 	
			
	
	
	twoway  (rspike salary_real_max salary_real_min rank if termlimit==0, horizontal lcolor(black) lwidth(medthin)) ///
			(dot salary_real_mean rank if termlimit==0 ,horizontal ndots(1) mcolor(black) msymbol(O) msize() mfcolor(white))  ///
			(rspike salary_real_max salary_real_min rank if termlimit==1, horizontal lcolor(red) lwidth(medthin)) ///
			(dot salary_real_mean rank if termlimit==1 ,horizontal ndots(1) mcolor(red) msymbol(square) msize() mfcolor(white)) ///
			(rspike salary_real_max salary_real_min rank if termlimit==2, horizontal lcolor(blue) lwidth(medthin)) ///
			(dot salary_real_mean rank if termlimit==2 ,horizontal ndots(1) mcolor(blue) msymbol(diamond) msize(large) mfcolor(blue)), ///
			`call' /// 
			subtitle(, bcolor(white)) graphregion(color(white))    ///
			ytitle("") xscale(range(-25 200)) xlabel( 0 (25) 250, labsize(medlarge) )  xtitle("Legislator Compensation ($)" "(Min-Mean-Max)") ///
			legend(order(2 "States without Term Limits" 4 "States with Term Limits" 6 "Added Control States without Term Limits") ring(0) cols(1) pos(5) ) ///
			graphregion(color(white)) bgcolor(white) ylabel("") yscale(lstyle(none)) scale(*0.65) xsize(10) ysize(8) 	
			graph export ../tables_figures/state_rank_salary.pdf, replace				
	
		